package preferences;

public enum Operator {

    EQ {

        public String toString() {
            return "=";
        }
    },
    NEQ {

        public String toString() {
            return "<>";
        }
    },
    GT {

        public String toString() {
            return ">";
        }
    },
    GE {

        public String toString() {
            return ">=";
        }
    },
    LT {

        public String toString() {
            return "<";
        }
    },
    LE {

        public String toString() {
            return "<=";
        }
    },
    LIKE {

        public String toString() {
            return "LIKE";
        }
    },;

    @Override
    public abstract String toString();

    public static Operator getOperator(String str) {
        if (str.equals(EQ.toString())) {
            return EQ;
        }else if (str.equals(NEQ.toString())) {
            return NEQ;
        }else if (str.equals(GT.toString())) {
            return GT;
        }else if (str.equals(GE.toString())) {
            return GE;
        }else if (str.equals(LT.toString())) {
            return LT;
        }else if (str.equals(LE.toString())) {
            return LE;
        }else if(str.equals(LIKE.toString()))
            return LIKE;
        else return null;
    }
}

